window.onload = function () {
  let isChecked: any = window.localStorage.getItem('isChecked');
  if (!isChecked) {
    window.localStorage.setItem('isChecked', 0);
  }
  if (isChecked) {
    document.querySelector('#box')!.checked = true;
    document.querySelector('#status')!.innerHTML = '是'
  }
  else {
    document.querySelector('#box')!.checked = false;
    document.querySelector('#status')!.innerHTML = '否'
  }
}
const isopen: any = () => {
  let isChecked: any = window.localStorage.getItem('isChecked');
  if (isChecked == 0) {
    window.localStorage.setItem('isChecked', 1);
    document.querySelector('#status')!.innerHTML = '是'
  }
  else {
    window.localStorage.setItem('isChecked', 0);
    document.querySelector('#status')!.innerHTML = '否'
  }
  // alert(window.localStorage.getItem('isChecked'))
}
document.querySelector('#box')?.addEventListener('click', isopen);
